﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frogism.Core;

namespace Frogism.Domain {
  public class MarketAdjuster {
    public static Core.ITransaction Adjust(Core.IAccount account, decimal NewBalance){

      Core.Transaction transaction = new Core.Transaction();
      transaction.AccountId = account.Id;
      transaction.Id = -1;
      transaction.IsConfirmed = true;
      transaction.Note = "M/A";
      transaction.TransactionDate = DateTime.Now.CleanDate();
      transaction.TransactionType = TransactionType.Create(DBConst.TransactionTypeMarketAdjustment);
      transaction.Amount = NewBalance - account.Balance;
      return transaction;
    }
  }
}
